/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mldn.demo.petshop;

/**
 *
 * @author Administrator
 */
public class PetShopDemo {
    public static void main(String[] args) {
        PetStore ps = new PetStore(6);
        ps.add(new Cat("白猫","白色的",2));
        ps.add(new Cat("黑猫","黑色的",3));
        ps.add(new Cat("花猫","花色的",3));
        ps.add(new Dog("黄狗","黄色的",3));
        ps.add(new Dog("拉布拉多","黑色的",3));
        ps.add(new Dog("金毛","褐色的",3));
        print(ps.search("褐"));
        System.out.println(new Cat("zhang","whie",3).toString());
        
    }
    
    public static void print(Pet[] pet){
        for (int i = 0; i < pet.length; i++) {
            if (pet[i] != null) {
                System.out.println(pet[i].getName()
                        +","+pet[i].getColor()+","
                        +pet[i].getAge());
            }
        }
    }
    
}
